home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 1997
/
MacHack 1997.toast
/
Hacks
/
Hacks ’96
/
FinderFlocks
/
FlockUtils.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-06-22
|
1KB
|
46 lines
#pragma once
#include "FlockTypes.h"
/* The flock actually deals with this block, but everybody needs to know about it */
typedef struct // These all range from 0 to 100, inclusive, like the After Dark sliders
{
long fNumBoidsCtl;
long fBoidTypeCtl;
double fComfyDistCtl;
double fAwareDistCtl;
double fAvoidMaxCtl;
double fMatchMaxCtl;
double fCenterMaxCtl;
double fMaxEffortCtl;
double fMaxAccelCtl;
double fMaxVelocityCtl;
}ControlRec;
typedef struct // These all range from 0 to 100, inclusive, like the After Dark sliders
{
short fNumBoidsCtl;
short fBoidTypeCtl;
short fScreenCtl;
short fComfyDistCtl;
short fAwareDistCtl;
short fAvoidMaxCtl;
short fMatchMaxCtl;
short fCenterMaxCtl;
short fMaxEffortCtl;
short fMaxAccelCtl;
short fMaxVelocityCtl;
}ShortControlRec; // size = 20 bytes
// Prototypes for utility functions
short abs(short i);
void TwoVecAvg(FloatPoint *a, FloatPoint *b);
double VecMagSq(double h, double v);
void Clamp(FloatPoint *vec, double max);
long BuildMap(Handle *theMap, Rect *theRect, short theDepth);
long SizePixMap(PixMapHandle ThePix, Rect *TheRect);
long SizeBitMap(BitMap *TheMap, Rect *TheRect);
void FlockControlKey(char key);
void GetNewControls(ControlRec *controls, long type);
void DrawControlValues(Rect *screenRect);